﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Roguelike
{
    class Game
    {
        static void Main(string[] args)
        {
            Singleton<ScreenManager>.instance.InitializeScreen();

            while (true)
            {
                // Reads a single keystroke from the console and stores it
                char keyPressed = Console.ReadKey(true).KeyChar;

                // If the keystroke is a valid command, update the game state with the corresponding input information
                // and redraw the map; otherwise the loop starts over and waits for another keystroke
                if (Singleton<InputManager>.instance.TestValidInputKey(keyPressed) == true)
                {
                    Singleton<GameManager>.instance.Update(Singleton<InputManager>.instance.GetInput(keyPressed));
                    Singleton<ScreenManager>.instance.DrawMap();
                }
            }
        }
    }
}
